<template>
  <a-modal
    title="操作日志详情"
    :width="900"
    :visible="visible"
    :destroyOnClose="true"
    :keyboard="false"
    :maskClosable="false"
    @cancel="handleCancel"
  >

    <template slot="footer">
      <a-button type="primary" @click="handleCancel">知道了</a-button>
    </template>
    <a-card :bordered="false">
      <a-descriptions>
        <a-descriptions-item label="操作模块" :span="1">{{ detailInfo.module }} / {{ detailInfo.title }}</a-descriptions-item>
        <a-descriptions-item label="请求地址" :span="2">{{ detailInfo.operatorUrl }}</a-descriptions-item>
        <a-descriptions-item label="请求方式" :span="1">{{ detailInfo.requestType }}</a-descriptions-item>
        <a-descriptions-item label="操作人信息" :span="2">{{ detailInfo.operator }} / {{ detailInfo.operatorIp }} / {{ detailInfo.operatorLocation }}</a-descriptions-item>
        <a-descriptions-item label="操作方法" :span="3">{{ detailInfo.methodLink }}</a-descriptions-item>
        <a-descriptions-item label="请求参数" :span="3">{{ detailInfo.operatorParam }}</a-descriptions-item>
        <a-descriptions-item label="状态" :span="1">	<a-tag :color="detailInfo.status === true ? 'green' : 'red'">{{ detailInfo.status === true ? '成功' : '失败' }}</a-tag></a-descriptions-item>
        <a-descriptions-item label="操作时间" :span="2">	{{ detailInfo.createTime }}</a-descriptions-item>
        <a-descriptions-item label="失败错误代码" :span="3">	{{ detailInfo.errorMsg }}</a-descriptions-item>
      </a-descriptions>
    </a-card>
  </a-modal>
</template>

<script>
export default {
  name: 'OperateLogDetails',
  data () {
    return {
      visible: false,
      detailInfo: []
    }
  },
  methods: {
    details (record) {
      this.visible = true
      this.detailInfo = record
    },
    onOk () {
      this.visible = false
    },
    handleCancel (e) {
      this.visible = false
    }
  }
}
</script>

<style scoped>

</style>
